fix(test): set --max-old-space-size=6144 on test:coverage to prevent OOM under --runInBand#3554
Conversation
…OOM under --runInBand `test:coverage` runs `jest --runInBand` (single Node process) so `workerIdleMemoryLimit` from #3550 does not apply — there are no worker children to recycle. Without an explicit heap cap, Node defaults to ~2 GB old-space which is enough for devkit (~18 suites) but immediately OOMs on larger downstream test suites (trawl_node hit OOM at 1.9 GB on 214 suites). Setting `--max-old-space-size=6144` matches the existing per-project override that downstream projects had to maintain locally as patches. Bumping it upstream eliminates the divergence and prevents the `feedback_update_stack_theirs_wipes_patches` failure mode where `/update-stack --theirs` silently strips the override. Sized for the largest known downstream (trawl_node ~214 suites peaks ~4.3 GB pre-fixes / ~2 GB post). Headroom keeps room for further growth without re-tuning. CI runners on lily ARC have ≥6 GiB, GitHub-hosted runners have 7 GiB — both fit. Note: `workerIdleMemoryLimit: '512MB'` from #3550 still applies for non- coverage parallel runs (`test:parallel-smoke`, etc.) where worker children exist.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
Updates the repository’s coverage test script to raise Node’s V8 old-space heap limit, preventing out-of-memory crashes when running large Jest suites under --runInBand in downstream projects.
Changes:
- Add
--max-old-space-size=6144toNODE_OPTIONSfortest:coverage.
There was a problem hiding this comment.
Pull Request Overview
The pull request successfully increases the Node.js heap memory limit to 6GB for the test:coverage script to prevent Out-Of-Memory errors in large test suites. Codacy analysis indicates the changes are up to standards with no new issues. However, there is a concern regarding the choice of 6GB on environments with 7GB total RAM (like GitHub Actions), as this leaves very little overhead for the OS and non-heap memory, potentially leading to non-deterministic SIGKILL failures. Additionally, several other scripts using --runInBand remain at default limits, which may lead to similar OOM issues in those contexts.
About this PR
- The memory limit increase is currently only applied to
test:coverage. Other scripts that utilize--runInBand(e.g.,test:all,test:unit,test:integration) are still subject to default Node.js memory limits. Consider evaluating if these should also be updated to ensure consistency and prevent OOM errors across the entire test suite.
Test suggestions
- Verify that 'test:coverage' command executes with the 6GB memory limit applied.
- Verify that other in-band scripts (test:all, test:integration) are not causing OOM in downstream projects or evaluate if they also need the memory increase.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that other in-band scripts (test:all, test:integration) are not causing OOM in downstream projects or evaluate if they also need the memory increase.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3554 +/- ##
=======================================
Coverage 87.87% 87.87%
=======================================
Files 128 128
Lines 3589 3589
Branches 1054 1054
=======================================
Hits 3154 3154
Misses 345 345
Partials 90 90 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
--max-old-space-size=6144totest:coverageNODE_OPTIONS/update-stack --theirsWhy
test:coveragerunsjest --runInBand— single Node process, no worker children. TheworkerIdleMemoryLimit: '512MB'added in #3550 only recycles worker processes, so it doesn't apply on coverage runs.Without an explicit cap, Node defaults to ~2 GB old-space. Devkit's own ~18 suites fit, but trawl_node (214 suites) immediately OOMs at 1.9 GB on the
chore/update-stack-2026-05-01propagation run today.Trawl had a downstream patch setting 6144 — the recent
/update-stackpropagation wiped it via--theirs(cf.feedback_update_stack_theirs_wipes_patches), causing the OOM. Restoring it locally would just recreate the same drift. Fix it upstream.Test plan
package.jsonpatch from commit 042fdc9e becomes redundant and can be dropped on the next/update-stackRelated
Summary by CodeRabbit